import os
import pytest

if __name__ == "__main__":
    # 生成allure报告
    pytest.main([
        "tests/",
        "--alluredir", "reports/allure-results",
        "-v",  # 详细日志
        "-s"   # 输出打印信息
    ])
    # 自动打开报告（可选）
    os.system("allure serve reports/allure-results")